# 抽象产品类A
class ProductA:
    def use(self):
        pass

# 具体产品类A1
class ConcreteProductA1(ProductA):
    def use(self):
        print("Using ConcreteProductA1")

# 具体产品类A2
class ConcreteProductA2(ProductA):
    def use(self):
        print("Using ConcreteProductA2")

# 抽象工厂类
class Factory:
    def create_product_a(self):
        pass

# 具体工厂类，用于创建具体产品类A1
class Factory1(Factory):
    def create_product_a(self):
        return ConcreteProductA1()

# 具体工厂类，用于创建具体产品类A2
class Factory2(Factory):
    def create_product_a(self):
        return ConcreteProductA2()

# 客户端代码
def client_code(factory: Factory):
    product_a = factory.create_product_a()
    product_a.use()

# 使用示例
if __name__ == "__main__":
    print("Client: I'm using the first factory.")
    factory1 = Factory1()
    client_code(factory1)

    print("\nClient: I'm using the second factory.")
    factory2 = Factory2()
    client_code(factory2)

'''
代码实现：
Client: I'm using the first factory.
Using ConcreteProductA1

Client: I'm using the second factory.
Using ConcreteProductA2
'''